const mysql = require("mysql");
const dbConfig = require("../../db.config");

const connection = mysql.createConnection({
    host:dbConfig.HOST,
    port:dbConfig.PORT,
    user:dbConfig.USER,
    password:dbConfig.PASSWORD,
    database:dbConfig.DB
});

connection.connect((err) =>{
    if(err){
        throw err;
    }
    console.log("Successfully connected to the database.");
});

module.exports = connection;